<template>
  <el-dialog v-drag-dialog title="上传商品图片" :visible.sync="dialogVisible" width="80%" :show-close="false" :close-on-press-escape="false" :close-on-click-modal="false">
    <pic-upload action="UploadSpDisplayMap" :data="data" @success="onSuccess" @cancel="onCancel"></pic-upload>
  </el-dialog>
</template>

<script>
import picUpload from "@/components/picture/picupload";
export default {
  components: { picUpload },
  data() {
    return {
      dialogVisible: false,
      data: {
        //商品ID
        sp_id: 0
      }
    };
  },
  methods: {
    Show(id) {
      this.data.sp_id = id;
      this.dialogVisible = true;
    },
    onSuccess() {
      this.dialogVisible = false;
      this.$emit("success");
    },
    onCancel() {
      this.dialogVisible = false;
    }
  }
};
</script>